package cn.com.blueInfo.bpm.template.entity;

import cn.com.blueInfo.bpm.common.entity.BaseEntity;
import cn.com.blueInfo.bpm.template.enums.EventActionType;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 事件动作表
 * @author suxch
 * @since 2025-08-24 01:41:15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "mc_uniflow_event_action", autoResultMap = true)
@Schema(description = "事件动作表")
public class EventAction extends BaseEntity {

    /** ID */
    @TableId(type = IdType.INPUT)
    @Schema(description = "ID")
    private Long id;
    /** 事件ID */
    @Schema(description = "事件ID")
    private Long eventId;
    /** 动作类型：NODE_JUMP-跳转节点，SEND_NOTIFY-发送通知，AUTO_APPROVE-自动审批 */
    @Schema(description = "动作类型：NODE_JUMP-跳转节点，SEND_NOTIFY-发送通知，AUTO_APPROVE-自动审批")
    private EventActionType actionType;
    /** 动作参数（JSON 格式，如跳转节点动作：{\"target_node_id\": 123}；通知动作：{\"user_ids\": [1,2]}） */
    @Schema(description = "动作参数（JSON 格式，如跳转节点动作：{\"target_node_id\": 123}；通知动作：{\"user_ids\": [1,2]}）")
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONObject actionParam;

}
